package VN.EDU.IMIC.DEVELOPER.VUVANLUANLEVEL2.EXR0304;

import java.util.Scanner;

public class views {

	public static void main(String[] args) {
		informationside objcal = new informationside();
		Scanner sc = new Scanner(System.in);
		System.out.println("Ban muon tinh toan voi 1-Hinh vuong hay 2-Hinh chu nhat ?");
		int phepchon = sc.nextInt();
		controller objcontroller = new controller();
		if(phepchon == 1){System.out.println("Xin moi nhap canh cua hinh vuong");
		objcal.setSide(sc.nextDouble());
		System.out.println("Chu vi hinh vuong canh "+objcal.getSide() + " la : " + objcontroller.perimeterHV(objcal));
		System.out.println("Dien tich hinh vuong canh "+ objcal.getSide() + " la " + objcontroller.areaHV(objcal));
		}else{
			if(phepchon == 2){System.out.println("Xin moi nhap chieu dai hinh chu nhat :");
			objcal.setHeight(sc.nextDouble());
			System.out.println("Xin moi nhap chieu rong hinh chu nhat : ");
			objcal.setWidth(sc.nextDouble());
			System.out.println(" Chu vi hinh chu nhat do la : " + objcontroller.PerimeterHCN(objcal));
			System.out.println("Dien tich hinh chu nhat do la : "+ objcontroller.AreaHCN(objcal));
			}else {System.out.println("Xin moi chon hinh chu nhat hoac hinh vuong !!!");}
		}
	}

}
